package cn.shengchao.rule.base;

import cn.shengchao.rule.condition.ICondition;
import cn.shengchao.rule.condition.LogicalOperatorCs;
import lombok.Data;

import java.util.List;
import java.util.Map;

/**
 * @program: examstarapi
 * @description: 条件组(规则里一个条件组就是一个有动作结果的独立规则)
 * @author: Xiong weiqiang
 * @create: 2025-04-07 21:08
 */
@Data
public class ConditionGroup {
    // 逻辑运算符 (AND/OR)
    public String loadLogicalOperator() {
        return LogicalOperatorCs.AND;
    }
    //指定条件组id
    private Long groupId;
    //指定规则id
    private Long ruleId;
    // 条件列表
    private List<ICondition> conditions;
    // 执行动作
    private IAction action;

    public IAction doActionIfMatch(Map<String,String> targetValueMap) {
        return action;
    }
}